
Partial Class UpdateArticles
    Inherits System.Web.UI.Page
    Private currentUser As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        currentUser = HttpContext.Current.Profile.UserName
        If currentUser = "admin" Then
            ObjectDataSource1.SelectMethod = "GetAllArticles"
        Else
            ObjectDataSource1.SelectMethod = "GetArticlesByUserID"
        End If

    End Sub

   
    Protected Sub ObjectDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource1.Selecting
        If Not currentUser = "admin" Then e.InputParameters("UserID") = currentUser
    End Sub
End Class
